#include "Udp_Server.hpp"

#include <memory>

void usage() {
  printf("usage:\n./UDP_server port\n");
}

int main(int argc, char* argv[]) {
  if(argc != 2) {
    // 正确用法：./UDP_server port
    usage();
    exit(1);
  }
  
  uint16_t serverport = std::stoi(argv[1]);
  std::unique_ptr<UdpServer> up(new UdpServer(serverport));

  up->InitServer();

  up->StartServer();
  return 0;
}
